<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box{
            width:500px;
            height: 400px;
            border:1px solid red;
        }
        .img{
            width:200px;
            height:200px;
            background-color: pink;
            display:inline-block;               /* display:inline-block; 和vertical-align:middle; 搭配使文字与图片垂直 */
            vertical-align:middle;
        }
    </style>
</head>
<body>
   <div class="box">
       <div class="img"></div>
       dsjsdlksj
   </div>
</body>
</html>